/* eslint-disable */
const path = require('path')
const resolve = (dir) => path.join(__dirname, dir)

module.exports = {
	publicPath: process.env.NODE_ENV === 'production' ? '' : '/',
	productionSourceMap: false, // 生产环境不要SourceMap
	css: {
		// 若 less-loader 版本小于 6.0，请移除 lessOptions 这一级，直接配置选项。
		loaderOptions: {
			less: {
				modifyVars: {
					hack: `true; @import "${resolve('./src/assets/less/theme.less')}";`,
				},
				javascriptEnabled: true,
			},
		},
	},

	devServer: {
		port: 3000,
		proxy: {
			'/api': {
				target: 'https://test.com', //服务地址
				ws: false,
				changeOrigin: true,
				pathRewrite: {'^/api': ''},
			},
		},
	},
}
